/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
 * Description: 获取动态库中qos_manager接口函数的适配接口
 * Author: lanzeze
 * Create: 2023-06-27
 */

#ifndef HCCL_SRC_DLQOSFUNCTION_H
#define HCCL_SRC_DLQOSFUNCTION_H

#include <functional>
#include <mutex>
#include <hccl/hccl_types.h>

#include "base.h"
#include "lib_qos_manager.h"

namespace hccl {
class DlQosFunction {
public:
    virtual ~DlQosFunction();
    static DlQosFunction &GetInstance();
    HcclResult DlQosFunctionInit();
    std::function<QosErrorCode(QosStreamType label, QosEngineType engine, const std::string &op,
        int devId, QosConfig* info)> dlGetStreamEngineQos = nullptr;

protected:
private:
    void *handle_;
    std::mutex handleMutex_;
    DlQosFunction(const DlQosFunction&);
    DlQosFunction &operator=(const DlQosFunction&);
    DlQosFunction();
    HcclResult DlQosFunctionEschedInit();
};
}  // namespace hccl

#endif  // HCCL_SRC_DLQOSFUNCTION_H
